<% content_for(:per_page_js){javascript_include_tag("responses", "search_form")} %>

<%= flash_and_form_errors %>

<%= render("searches/form", :search => @search) %>

<%= index_table(Response, @responses) %>

<script type="text/javascript">
  // set id of latest response
  var responses_latest_id = <%= (f = @responses.first) ? f.id : "null" %>;
  var responses_submit_times = {};
  var responses_per_page = <%= Response.per_page %>;
  <% @responses.each do |r| %>
    responses_submit_times[<%= r.id %>] = "<%= r.created_at %>";
  <% end %>
  responses_setup_periodic_update();
</script>